import { Injectable } from '@angular/core';
import { HttpClient } from "@angular/common/http";

import * as  turf from '@turf/turf';
import { map } from 'rxjs/operators';
@Injectable({
  providedIn: 'root'
})
export class OverviewService {

  public statsURL = "mock-data/stats.json"
  public dynamicDataQueryURL = "http://test.cityfun.com.cn/api/test/pipeline/PipelineDynamicDataQuery"

  constructor(
    private http: HttpClient,
  ) { }

  public getDynamicPipeLine(params) {
    return this.http.get<any>(this.dynamicDataQueryURL, { params })
  }

  // 获取统计信息
  public getStatsData(id) {
    return this.http.get<any>(this.statsURL).pipe(
      map(data => data[id])
    )
  }

}
